package com.xqyq.service;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xqyq.dao.AdminDao;
import com.xqyq.model.Admin;

@Service
public class AdminService {
	@Autowired
	private AdminDao adminDao;
	
	public boolean login(Admin admin, HttpServletRequest request){
		admin = adminDao.login(admin);
		if(admin!=null){
			request.getSession().setAttribute("admin", admin);
			return true;
		}
		return false;
	}

}
